<html>
<%@ page language="java" contentType="text/html; charset=utf-8"    pageEncoding="utf-8"%>
<%@include file="header.jsp"%>
<script language="JavaScript" type="text/javascript" src="../datePicker/WdatePicker.js"></script>
<script>
function getPeijLeixing() {
    $.ajax({
    	type: "POST",
     	url: "fetchFittingTypeByBaseId.action",
     	data: "fittingtypebaseIdQ="+$.trim($("#fittingtypebaseIdQ")[0].value),
     	success: function(msg){
        	var data = eval(msg);
           	var selectObj =  document.getElementById("fittingTypeIdQ");

            var length = selectObj.length;
       		for(var i=length-1;i>=0;i--){
          		selectObj.remove(i);
          	}            
            for(var i = 0; i < data.length;i++) {
                   selectObj.options.add(new Option(data[i].name,data[i].id));
            }
     	}   
  	});
}
</script>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.STYLE1 {
	color: #666666;
	font-weight: bold;
}
.STYLE5 {color: #666666}
.STYLE6 {
	color: #135294;
	font-weight: bold;
}
-->
</style>

<body>
<form method="post" action="fittingList.action">
 <table width="80%" border="1" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" align="center">
 	<tr>
 		<td  colspan="4" background="images/bg_table.jpg" bgcolor="#ECEAE6" align="center">查询</td>
 	</tr>
	<tr bgcolor='#F1F3F5'>
 		<td width="20%">配件基本类型</td>
 		<td width="30%">
			<s:select list="fittingtypebases"  listValue="name" listKey="id"  name="fittingtypebaseIdQ" id="fittingtypebaseIdQ"  headerKey="-1" headerValue="--请选择类型--"  value="fittingtypebaseIdQ" onchange="getPeijLeixing()"  ></s:select> 		
 			<%--<input type="text" name="fittingTypeIdQ" id="fittingTypeIdQ" value="<s:property value='typeNameQ'/>" /> --%>
	  </td>
		<td>配件类型:</td>
		<td >
			 <select id="fittingTypeIdQ" name="fittingTypeIdQ"></select>
		</td>
	  </tr>
	  <tr>
 		<td>时间</td> 
	  <td colspan="3">
	  	<input class="Wdate" type="text" id="beginDate" name="beginDate" value="<s:property value='beginDate'/>"  onFocus="WdatePicker({isShowClear:false,readOnly:true})"/>
	  		-
	  	<input class="Wdate" type="text" id="endDate" name="endDate" value="<s:property value='endDate'/>" onFocus="WdatePicker({isShowClear:false,readOnly:true})"/>
  	  </td>
   
	</tr>	
	<tr>
		<td  colspan="4"    nowrap background="images/bg_table.jpg" bgcolor="#ECEAE6"  align="center"><input type="submit" /></td>
	</tr>
</table> 
</form>
<br/>
 
<div align="center">配件列表</div>
 <table width="80%" border="0" cellpadding="3" cellspacing="2" bgcolor="#FFFFFF" align="center">
 	<tr>
 		<td nowrap background="images/bg_table.jpg" bgcolor="#ECEAE6">产品类型</td>
 		<td nowrap background="images/bg_table.jpg" bgcolor="#ECEAE6">语言</td>
 		<td nowrap background="images/bg_table.jpg" bgcolor="#ECEAE6">操作</td>
 	</tr>
 	<s:iterator value="fittingList">
 	<tr bgcolor='#F1F3F5' onmouseover = "this.style.backgroundColor = '#FFDCB0'" onmouseout = "this.style.backgroundColor = ''">
 		<td><a href="<%=contextPath%>/pjDetail.action?peijianId=<s:property value='id'/>" target="_blank"><s:property value="typeName"/></a></td>
 		<td>
 			<s:if test='langId==0'>简体</s:if>
 			<s:if test='langId==1'>繁体</s:if>
 			<s:if test='langId==2'>英语</s:if>
 		</td>
 		<td>
 		<a href="beforUpdateFitting.action?fittingId=<s:property value='id'/>">编辑</a>
 		<a href="deleteFitting.action?fittingId=<s:property value='id'/>" onclick="javascript:if(confirm('确定删除该配件吗')) return true; else return false;">删除</a>
 		</td>
 	</tr>
 	</s:iterator>
 	<tr><td colspan="3" nowrap  bgcolor='#E4EDF9'>
 	<a href="fittingList.action?currentPage=<s:property value='prevPage'/>">上一页</a>
 	<a href="fittingList.action?currentPage=<s:property value='nextPage'/>">下一页</a>
 	共<s:property value='totalPage'/>页
 	<a href="fitting.action">新增</a></td><tr/>
 </table>
 </body>
 <script>
 getPeijLeixing();
 </script>
</html>